# -*- coding: utf-8 -*-
"""
@time：  2021/06/08  21:10
@Auto：Mr. xingye  993843278
@Company 星野训练营 99384378@qq.com
@Function:模块用意

"""
import json

import requests,jsonpath
session = requests.session()

result = session.post(url='http://42.192.168.57:8080/inter/HTTP//auth')
print(result.text)
jsont_str = json.loads(result.text)

token = jsonpath.jsonpath(jsont_str,'$.token')[0]
print(token)
params = {
"username": "xingye",
"password": 123456
}

# params = {'username': "xingye' or 1", 'password': '123456'}
session.headers['token'] = token
result = session.post(url='http://42.192.168.57:8080/inter/HTTP//login',data=params)
print(result.text)
result = session.post(url='http://42.192.168.57:8080/inter/HTTP//logout')
print(result.text)
